<div ng-controller="backlogListHaveDoneCtrl">
    <div class="table-header mt5 clearfix ng-scope">
        <span class="fl lh30 f14">已办流程管理</span>
    </div>

    <my-nav data-nav-items="filterDataType" onchanged="changeType" data-title="申请类型:"></my-nav>
    <my-nav data-nav-items="filterDataStatus" onchanged="changeStatus" data-title="申请状态:"></my-nav>

    <div class="section-table mt20">
        <div class="table-header lh30 pb5 clearfix">
            <span class="fl lh30 f14">已办列表</span>

            <div class="fr btn-group">
                <input class="input-text fl ng-pristine ng-untouched ng-valid ml3" style="width: 300px;" type="text"
                       placeholder="客户全称/合同编号" ng-model="getData.keyword" ng-enter="getData.doExecute()"/>
                <a class="btn" href="javascript: void(0)" ng-click="getData.doExecute()">查询</a>
            </div>
        </div>

        <div id="grid" class="table-wrap mt10">
            <table width="100%" class="valign-t">
                <thead>
                <tr>
                    <th style="text-align: center;width: 40px;">序号</th>
                    <th style="width: 100px;">出库单号</th>
                    <th style="width: 80px;">申请人</th>
                    <th style="width: 80px;">申请时间</th>
                    <th style="width: 80px;">申请类型</th>
                    <th style="width: 150px;">签约客户全称</th>
                    <th style="width: 150px;">顶级客户简称</th>
                    <th style="width: 150px;">所属区域</th>
                    <th style="width: 100px;">EKP合同编号</th>
                    <th style="width: 100px;">云链合同编号</th>
                    <th style="width: 80px;">出库进展</th>
                    <th style="width: 40px;">状态</th>
                    <th style="text-align: center;width: 150px;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat='record in deliverylist'>
                    <td style="text-align:center"><p ng-bind="$index + 1 + startPageIndex"></p></td>
                    <td>
                        <p ng-bind="record.order_code"></p>
                    </td>
                    <td>
                        <p ng-bind="record.deliver_name"></p>
                    </td>
                    <td>
                        <p ng-bind="record.delivery_time"></p>
                    </td>
                    <td>
                        <p ng-bind="record.delivery_scene"></p>
                    </td>
                    <td>
                        <p ng-bind="record.cst_fullname"></p>
                    </td>

                    <td>
                        <!--<p ng-bind="record.signguid"></p>-->
                        <p ng-bind="record.top_cst_shortname"></p>
                        <p ng-bind="record.delivery_guid"></p>
                    </td>
                    <td>
                        <p ng-bind="record.buname" style="word-break: break-all;"></p>
                    </td>
                    <td>
                        <p ng-bind="record.signno" style="word-break: break-all;"></p>
                    </td>
                    <td>
                        <p ng-repeat="item in record.stock_contract_info">
                            <a ng-href="/contract/edit.shtml#/base?id={{item.contract_id}}&contractType={{item.business_type_name}}" target="_blank" style="display: block; padding: 3px 0;">{{item.contract_code}}</a>
                        </p>
                    </td>
                    <td style="text-align:center">
                        <a id='showWorkflowProcess{{$index}}' href="javascript:;"
                           ui-dialog="查看流程信息"
                           ui-dialog-data="{'deliveryguid':record.delivery_guid}"
                           ui-dialog-show="backlogService.onWorkflowShow($dialog,$dialogScope,record.delivery_guid)"
                           ui-dialog-ok="backlogService.editBacklogSave($data,$dialog)"
                           ui-dialog-cache="false"
                           ui-dialog-url="/backlog/workflow_dialog.html"
                        >查看
                        </a>
                    </td>
                    <td>
                        <p ng-bind="record.delivery_status_name"></p>
                    </td>
                    <td style="text-align:center">
                        <a id='showDetail{{$index}}' href="javascript:;"
                           ui-dialog="查看出库信息"
                           ui-dialog-data="{'deliveryguid':record.delivery_guid}"
                           ui-dialog-show="backlogService.onBacklogShow($dialog,$dialogScope,record.delivery_guid,record.order_code)"
                           ui-dialog-ok="backlogService.editBacklogSave($data,$dialog)"
                           ui-dialog-cache="false"
                           ui-dialog-url="/backlog/edit_dialog.html"
                        >查看
                        </a>
                        <p ng-if="record.delivery_status==20 && record.delivery_scene == '特批产品'">
                            <a data-ng-click="startProcessApprove(record.delivery_guid)">发起审批</a>
                        </p>
                        <p ng-if="record.delivery_status==20">
                            <a data-ng-click="addenant(record.delivery_guid)">开通租户</a>
                        </p>
                        <p ng-if="[20,22].indexOf(record.delivery_status)>=0">
                            <a data-ng-click="accountAuth(record.delivery_guid)">账号授权</a>
                        </p>
                        <p ng-if="record.delivery_status==20 || record.delivery_status==22">
                            <a data-ng-click="refuseApprove(record.delivery_guid)">业财打回</a>
                        </p>
                        <!--<p>-->
                            <!--<a data-ng-click="recoverApprove(record.delivery_guid)">还原</a>-->
                        <!--</p>-->
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div id="pagination" class="pagination"></div>
</div>